import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/fund_list_model.g.dart';
import 'dart:convert';
export 'package:gold/generated/json/pool_list_model.g.dart';

@JsonSerializable()
class FundListModel {
	List<FundModel>? data;
	int? total;
	int? count;
	@JSONField(name: 'per_page')
	int? perPage;
	@JSONField(name: 'current_page')
	int? currentPage;
	@JSONField(name: 'total_pages')
	int? totalPages;

	FundListModel();

	factory FundListModel.fromJson(Map<String, dynamic> json) => $FundListModelFromJson(json);

	Map<String, dynamic> toJson() => $FundListModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class FundModel {
	/// 资金明细ID
	int? id;
	/// 用户ID
	@JSONField(name: 'user_id')
	int? userId;
	/// 变更金额
	int? amount;
	/// 变更后金额
	@JSONField(name: 'current_amount')
	int? currentAmount;
	/// 说明
	String? reason;
	/// 关联订单ID
	@JSONField(name: 'order_id')
	int? orderId;
	/// 关联提现ID
	@JSONField(name: 'withdrawal_id')
	int? withdrawalId;
	/// 提现信息
	WithdrawalModel? withdrawal;
	/// 创建时间
	@JSONField(name: 'created_at')
	String? createdAt;
	/// 用于展示的日期和时间
	String? showTime;

	FundModel();

	factory FundModel.fromJson(Map<String, dynamic> json) => $FundModelFromJson(json);

	Map<String, dynamic> toJson() => $FundModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class WithdrawalModel {
	/// 提现ID
	int? id;
	/// 状态：0: 处理中, 1: 成功, 2: 失败
	int? status;

	WithdrawalModel();

	factory WithdrawalModel.fromJson(Map<String, dynamic> json) => $WithdrawalModelFromJson(json);

	Map<String, dynamic> toJson() => $WithdrawalModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}